package java_thinking.unit_14._14_4;

/**
 * @Description : 修改15章的Coffee继承结构，以便可以使用注册工厂
 * @author: cww
 * @DateTime: 2019-03-30 14:36
 */

/*public class CoffeeGenerator implements Generator<Coffee>, Iterable<Coffee>{

    public CoffeeGenerator(){

    }
    private int size = 0;
    public CoffeeGenerator(int sz){
        this.size = sz;
    }
    public CoffeeGenerator next(){
        return CoffeeGenerator;
    }
    class CoffeeIterator implements Iterator<CoffeeGenerator>{
        int count = size;
        *//**
         * Returns {@code true} if the iteration has more elements.
         * (In other words, returns {@code true} if {@link #next} would
         * return an element rather than throwing an exception.)
         *
         * @return {@code true} if the iteration has more elements
         *//*
        @Override
        public boolean hasNext() {
            return count>0;
        }

        *//**
         * Returns the next element in the iteration.
         *
         * @return the next element in the iteration
         * @throws NoSuchElementException if the iteration has no more elements
         *//*
        @Override
        public CoffeeGenerator next() {
            count --;
            return null;
        }
    }
}*/
